﻿
stringfilter:host,lang,ref
;enable string filter in configuration for frontdoor first

[frontdoor]

;hddos configurations
bypassInternalRequest=true
;use ip as example, fakeInsertIntervalMS~1s, overall percent = 0.3, query length = 1024
;so if the frequence of requests is <=2s, after at most 1024/3*2s, the query will contains >1/3 request & <2/3 fake request,
;and the request will be blocked.
;debugmode$urlEnable=false
urlEnable=true
urlQueueLength=1024
;in the last 1024 requests <include fake insert requests, to avoid block forever, if no other users>,
;over 80% requests to a same url, then block this kind of requests
urlRejectOverallPercent=0.8
;if over 50% of current capacibility is for one url, then reject it
urlRejectCurrentPercent=0.5
;automatically fake some request, to avoid block forever if no other users
urlFakeInsertIntervalMS=512

;debugmode$resourceEnable=false
resourceEnable=true
resourceQueueLength=1024
resourceRejectOverallPercent=0.8
resourceRejectCurrentPercent=0.5
resourceFakeInsertIntervalMS=512

;debugmode$ipEnable=false
ipEnable=true
;debugmode$ipQueueLength=128
;debugmode$ipRejectOverallPercent=0.2
;debugmode$ipRejectCurrentPercent=0.2
;debugmode$ipFakeInsertIntervalMS=1024000000
ipQueueLength=1024
ipRejectOverallPercent=0.3
;should not use more then 20 threads from a single ip at same time
ipRejectCurrentPercent=0.2
ipFakeInsertIntervalMS=1024

;debugmode$refererEnable=false
refererEnable=true
refererQueueLength=1024
refererRejectOverallPercent=0.8
refererRejectCurrentPercent=0.5
refererFakeInsertIntervalMS=512

;the capacibility of current http server, such as the thread count of httpServer2
resourceCount=1024

;frontdoor configurations
port=80,81,88,800
staticCacheSize=1024
staticCacheLife=18000000
maintain=maintain.txt
error=errorpage.html
reject=reject.txt
holdtime=1800000; 30 minutes
delayjumpDelay=5

;supported filters for following rules
;httpcontext filters
;   host - host name in request
;   port - port in request
;   ua - user agent in request
;   ref - referer of request
;   ip - user ip
;   lang - language of user browser
;frontdoor filters
;   urlhash - hash value of url [0, maxUInt32], according to implement of string.GetHashCode()
;   pqhash - hash value of path and query [0, maxUInt32], according to implement of string.GetHashCode()
;   rnd - a random value, for randomly distributing [0, 99]
;as enabled stringfilter, so * and ? is workable here
;also valueinterval, 0-100 <means [0,100)> or [0,100] is workable here, but value of number only

[redirections]
;redirection rules definition, prefix=destination|delayjump

;some debug rules
debugmode$/&host:hzj-jie.gicp.net=http://www.hzj-jie.net/|true
;debugmode$/&host:localhost=http://127.0.0.1/|true

;send x% traffic to frontdoor.test
/&host:www.*&rnd:0-10=http://www.hzj-jie.net:800/|false
/&host:hzj-jie.net&port:88&rnd:0-10=http://share.hzj-jie.net:800/|false
/&host:hzj-jie.net&rnd:0-10=http://hzj-jie.net:800/|false
/&host:share.*&rnd:0-10=http://share.hzj-jie.net:800/|false
/&host:iis.*&rnd:0-10=http://iis.hzj-jie.net:800/|false
/&host:share2.*&rnd:0-10=http://share2.hzj-jie.net:800/|false
/&host:myapp.*&rnd:0-10=http://myapp.hzj-jie.net:800/|false
/&host:urlhandlers.*&rnd:0-10=http://urlhandlers.hzj-jie.net:800/|false
/&host:searchpk.*&rnd:0-10=http://searchpk.hzj-jie.net:800/|false
/&host:search.*&rnd:0-10=http://search.hzj-jie.net:800/|false
/&host:roomview.*&rnd:0-10=http://roomview.hzj-jie.net:800/|false
;frontdoor$/&host:rlss.in&rnd:0-10=http://rlss.in:800/|false

;some retired urls
/&host:hzj-jie.gicp.net=http://www.hzj-jie.net/|true
/&host:hzj-jie.vicp.net=http://share.hzj-jie.net/|true
/&host:hzj-jie.eicp.net=http://searchpk.hzj-jie.net/|true
;/&host:s.*&port:800=http://rlss.in:800/|true
/&host:s.*=http://rlss.in/|true
/&host:u.*=http://rlss.in/|true
/&host:z.*=http://rlss.in/|true
;/&host:*.rlss.in&port:800=http://rlss.in:800/|true
;/&host:*.rlss.in=http://rlss.in/|true
/my_applications/&host:share2.*=http://myapp.hzj-jie.net/|true
/my_applications/&host:myapp.*=http://myapp.hzj-jie.net/|true

[rules]
;rule definition, prefix=destination|needFDHeaders

;root rules, from /
;domain rules
;temporary use hfs to serve download requests from elpmis.*
/&port:800=http://hzj-jie-dev.gicp.net:800/
/&port:88=http://hzj-jie-dev.gicp.net:88/
/=http://hzj-jie-dev.gicp.net:81/
DEFAULT=http://hzj-jie-dev.gicp.net:81/

[staticfiles]
;staticfile definition, pathquery=destination|contentType
/__readme.txt__&lang:en-us*=readme.en.txt|text/plain\; charset=utf-8
/__readme.txt__=readme.zh.txt|text/plain\; charset=utf-8
/readme.txt&lang:en*=readme.en.txt|text/plain\; charset=utf-8
/readme.txt=readme.zh.txt|text/plain\; charset=utf-8
/__readme.en.txt__=readme.en.txt|text/plain\; charset=utf-8
/readme.en.txt=readme.en.txt|text/plain\; charset=utf-8
/__readme.zh.txt__=readme.zh.txt|text/plain\; charset=utf-8
/readme.zh.txt=readme.zh.txt|text/plain\; charset=utf-8
/__changelog.txt__=changelog.txt|text/plain\; charset=utf-8
/changelog.txt=changelog.txt|text/plain\; charset=utf-8
/robots.txt=robots.txt|text/plain\; charset=utf-8
/knownissues.txt=knownissues.txt|text/plain\; charset=utf-8
/coming&host:hzj-jie.oicp.net&lang:en*=coming.en.html|text/html\; charset=utf-8
/coming&host:hzj-jie.oicp.net=coming.zh.html|text/html\; charset=utf-8
/coming.jpg&host:hzj-jie.oicp.net=coming.jpg|image/jpeg
/favicon.ico&host:unnamedhighland.gicp.net=wmgd.ico|image/x-icon
/favicon.ico&host:*wm8090.*=wmgd.ico|image/x-icon
debugmode$/__THIS_IS_A_TEST_REQUEST__=THIS_IS_A_NONEXISTING_FILE|text/plain\;;THIS_SHOULD_BE_COMMENT
/BingSiteAuth.xml=BingSiteAuth.xml
/googlea06cf6332d3f934f.html=googlea06cf6332d3f934f.html

